﻿using SQLite;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Xarmarin.GoldFinger.Engine.Core;
using Xarmarin.GoldFinger.Engine.Rand;
using Xarmarin.GoldFinger.ViewModels;

namespace Xarmarin.GoldFinger.Models.AutoModels
{
    /// <summary>
    /// 角色表
    /// </summary>
    public class Auto_Subject : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        #region 基础信息
        /// <summary>
        /// 流水号
        /// </summary>
        [PrimaryKey, NotNull] public long ID { get; set; }
        /// <summary>
        /// 系统编码
        /// </summary>
        [NotNull] public string Code { get; set; }
        /// <summary>
        /// 账号
        /// </summary>
        [NotNull] public string Account { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }

        private long _Sex;

        /// <summary>
        /// 性别
        /// <summary>
        public long Sex
        {
            set
            {
                if (_Sex != value)
                {
                    _Sex = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Sex)));
                }
            }
            get
            {
                return _Sex;
            }
        }

        #endregion

        #region 人物状态
        private string _NickName;

        /// <summary>
        /// 道号
        /// <summary>
        public string NickName
        {
            set
            {
                if (_NickName != value)
                {
                    _NickName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(NickName)));
                }
            }
            get
            {
                return _NickName;
            }
        }

        private string _RealName;
        /// <summary>
        /// 本名
        /// <summary>
        public string RealName
        {
            set
            {
                if (_RealName != value)
                {
                    _RealName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(RealName)));
                }
            }
            get
            {
                return _RealName;
            }
        }
        /// <summary>
        /// 头像
        /// <summary>
        public string IcoFace { get; set; }

        /// <summary>
        /// 境界描述
        /// <summary>
        public long State { get; set; }
        public string _StateStr;
        /// <summary>
        /// 境界描述
        /// <summary>
        public string StateStr
        {
            set
            {
                if (_StateStr != value)
                {
                    _StateStr = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(StateStr)));
                }
            }
            get
            {
                return _StateStr;
            }
        }
        /// <summary>
        /// 小境界
        /// <summary>
        public long SmallState { get; set; }

        public string _SmallStateStr;
        /// <summary>
        /// 小境界描述
        /// <summary>
        public string SmallStateStr
        {
            set
            {
                if (_SmallStateStr != value)
                {
                    _SmallStateStr = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SmallStateStr)));
                }
            }
            get
            {
                return _SmallStateStr;
            }
        }

        private long _Age;
        /// <summary>
        /// 修炼时间
        /// <summary>
        public long Age
        {
            set
            {
                if (_Age != value)
                {
                    _Age = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Age)));
                }
            }
            get
            {
                return _Age;
            }
        }

        private long _LifeYear;
        /// <summary>
        /// 寿命
        /// <summary>
        public long LifeYear
        {
            set
            {
                if (_LifeYear != value)
                {
                    _LifeYear = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(LifeYear)));
                }
            }
            get
            {
                return _LifeYear;
            }
        }
        private string _SectName;

        private long _Mana;
        /// <summary>
        /// 修为
        /// <summary>
        public long Mana
        {
            set
            {
                if (_Mana != value)
                {
                    _Mana = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Mana)));
                }
            }
            get
            {
                return _Mana;
            }
        }

        private long _NextMana;
        /// <summary>
        /// 突破修为 
        /// <summary>
        public long NextMana
        {
            set
            {
                if (_NextMana != value)
                {
                    _NextMana = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(NextMana)));
                }
            }
            get
            {
                return _NextMana;
            }
        }


        private long _MixGetMana;
        /// <summary>
        ///最小获取修为
        /// <summary>
        public long MixGetMana
        {
            set
            {
                if (_MixGetMana != value)
                {
                    _MixGetMana = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MixGetMana)));
                }
            }
            get
            {
                return _MixGetMana;
            }
        }
        private long _MaxGetMana;

        /// <summary>
        ///最大获取修为
        /// <summary>
        public long MaxGetMana
        {
            set
            {
                if (_MaxGetMana != value)
                {
                    _MaxGetMana = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MaxGetMana)));
                }
            }
            get
            {
                return _MaxGetMana;
            }
        }

        /// <summary>
        /// 宗门
        /// <summary>
        public string SectName
        {
            set
            {
                if (_SectName != value)
                {
                    _SectName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SectName)));
                }
            }
            get
            {
                return _SectName;
            }
        }

        /// <summary>
        /// 宗门地位
        /// <summary>
        public long SectPosition { get; set; }

        private string _SectPositionStr;

        /// <summary>
        /// 宗门地位
        /// <summary>
        public string SectPositionStr
        {
            set
            {
                if (_SectPositionStr != value)
                {
                    _SectPositionStr = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SectPositionStr)));
                }
            }
            get
            {
                return _SectPositionStr;
            }
        }

        #endregion

        #region 属性
        
        private double _Lucy;
        /// <summary>
        /// 气运
        /// <summary>
        public double Lucy
        {
            set
            {
                if (_Lucy != value)
                {
                    _Lucy = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Lucy)));
                }
            }
            get
            {
                return _Lucy;
            }
        }


        private long _Karma;
        /// <summary>
        /// 因果
        /// <summary>
        public long Karma
        {
            set
            {
                if (_Karma != value)
                {
                    _Karma = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Karma)));
                }
            }
            get
            {
                return _Karma;
            }
        }

        private long _ManaRoot;
        /// <summary>
        /// 灵根--先天生成，除非天才地宝或奇遇否则无法提升        
        /// <summary>
        public long ManaRoot
        {
            set
            {
                if (_ManaRoot != value)
                {
                    _ManaRoot = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ManaRoot)));
                }
            }
            get
            {
                return _ManaRoot;
            }
        }

        private string _ManaRootDesc;

        /// <summary>
        /// 灵根描述 
        /// <summary>
        public string ManaRootDesc
        {
            set
            {
                if (_ManaRootDesc != value)
                {
                    _ManaRootDesc = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ManaRootDesc)));
                }
            }
            get
            {
                return _ManaRootDesc;
            }
        }

        private long _Mind;
        /// <summary>
        /// 神魂 
        /// <summary>
        public long Mind
        {
            set
            {
                if (_Mind != value)
                {
                    _Mind = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Mind)));
                }
            }
            get
            {
                return _Mind;
            }
        }

        private long _Physique;
        /// <summary>
        /// 体魄
        /// <summary>
        public long Physique
        {
            set
            {
                if (_Physique != value)
                {
                    _Physique = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Physique)));
                }
            }
            get
            {
                return _Physique;
            }
        }
        
        private long _Savvy;
        /// <summary>
        /// 悟性
        /// <summary>
        public long Savvy
        {
            set
            {
                if (_Savvy != value)
                {
                    _Savvy = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Savvy)));
                }
            }
            get
            {
                return _Savvy;
            }
        }


        private long _Power;
        /// <summary>
        ///灵力--决定攻击力
        /// <summary>
        public long Power
        {
            set
            {
                if (_Power != value)
                {
                    _Power = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Power)));
                }
            }
            get
            {
                return _Power;
            }
        }


        #endregion

        #region 财富

        private long _Sengoku;

        /// <summary>
        /// 仙石
        /// <summary>
        public long Sengoku
        {
            set
            {
                if (_Sengoku != value)
                {
                    _Sengoku = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Sengoku)));
                }
            }
            get
            {
                return _Sengoku;
            }
        }


        private long _ManaStone;

        /// <summary>
        /// 灵石
        /// <summary>
        public long ManaStone
        {
            set
            {
                if (_ManaStone != value)
                {
                    _ManaStone = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ManaStone)));
                }
            }
            get
            {
                return _ManaStone;
            }
        }

        #endregion
        



        [NotNull] public long Status { get; set; }


        




        public long? Sort { get; set; } // integer
        [NotNull] public DateTime CreatedTime { get; set; } // datetime
        [NotNull] public DateTime UpdatedTime { get; set; } // datetime
    }

}
